<?
ob_start();
	session_start();
	//echo "username: $_POST[user] <br>";
	//echo "password: $_POST[passwd]<br> ";
	if(($_POST['user']=="admin") && ($_POST['passwd']=="imms123456")){
		setcookie("username",$_POST['user'],time()+60);
		setcookie("passwd",$_POST['passwd'],time()+60);
		setcookie("usermode","ADM",time()+60);		
	}else if(($_POST['user']=="user") && ($_POST['passwd']=="123456")){
		setcookie("username",$_POST['user'],time()+60);
		setcookie("passwd",$_POST['passwd'],time()+60);
		setcookie("usermode","USR",time()+60);		
	}else{
		echo "Error Login";
		exit();
	}
    //header("Location: http://192.168.1.36/bhm/mainmenu.php");
	header("Location: http://localhost/bhm/menu01.php");
ob_end_flush(); 
?>